package com.ray.service;

import com.ray.pojo.Hello;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class HelloServiceImpl implements HelloService
{
    @Override
    public void getHelloBySpring()
    {
        ApplicationContext cpx = new ClassPathXmlApplicationContext("beans.xml");
        Hello hello = cpx.getBean("hello", Hello.class);
        Hello hello1 = (Hello) cpx.getBean("hello");
        System.out.println(hello.toString());
    }

    @Override
    public void getHelloByJava()
    {
        Hello hello = new Hello();
        hello.setName("Hello Spring");
        System.out.println(hello.toString());
    }
}
